import request from '@/utils/request'
import { CommonSearch } from '@/config/list'
import { SystemDefineList, SystemDefineData } from '@/model/system/setting/model'

export function loadDefineList (data: CommonSearch) {
  return request<SystemDefineList>({
    url: '/starDefine/getDefineList',
    data: data,
    method: 'post'
  })
}

export function saveDefine (data: SystemDefineData) {
  return request({
    url: '/starDefine/save',
    data: data,
    method: 'post'
  })
}

export function getMaxIndex () {
  return request({
    url: '/starDefine/getMaxIndex'
  })
}

export function getDefineById (id: string) {
  return request({
    url: `/starDefine/getDefineById?id=${id}`
  })
}

export function removeDefine (id: string) {
  return request({
    url: `/starDefine/removeDefine?id=${id}`
  })
}
